<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:math="http://exslt.org/math"
                xmlns:func="http://exslt.org/functions"
                extension-element-prefixes="func math">

<func:function name="math:power">
  <xsl:param name="base" select="/.." />
  <xsl:param name="power" select="/.." />

  <xsl:choose>
    <xsl:when test="$power = 0">
  	   <func:result select="1" />
    </xsl:when>
    <xsl:otherwise>
      <func:result select="$base * math:power($base, $power - 1)" />
    </xsl:otherwise>  
  </xsl:choose>  
</func:function>

</xsl:stylesheet>